﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DLM.Infrastructure.Domain;

namespace DLM.Domain.Model
{
    /// <summary>
    /// Party type
    /// </summary>
    public class Type : IValidatableObject, IAggregateRoot
    {

        public int PID { get; set; }
        public string Name { get; set; }

        [Required(ErrorMessage="活动类型不允许为空")]
        public int PartyType { get; set; }

        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (string.IsNullOrEmpty(Name))
            {
                yield return new ValidationResult("", new string[] { "Name" });
            }
        }
    }
}
